package leecode0_1;

import java.util.Arrays;

public class canMakeArithmeticProgression {
    public static void main(String[] args) {
        int[] arr = new int[]{1,2,4};
        Arrays.sort(arr);
        int sub = arr[1]-arr[0];
        int key = 0;
        for (int i = 0; i < arr.length-1; i++) {
            if (arr[i+1]-arr[i] != sub){
               key=1;
            }
        }
        if (key == 0){
            System.out.println("可以排成等差数列");
        }else {
            System.out.println("不可以排成等差数列");
        }

    }
}
